<?php

class LinkColumn extends ButtonColumn {

    public $template = '{update}';
    public $buttons = array('update', 'inactive', 'active');

    protected function renderButton($id, $button, $row, $data) {
        if (isset($button['visible']) && !$this->evaluateExpression($button['visible'], array('row' => $row, 'data' => $data)))
            return;
        $url = isset($button['url']) ? $this->evaluateExpression($button['url'], array('data' => $data, 'row' => $row)) : '#';
        $title = isset($button['title']) ? $this->evaluateExpression($button['title'], array('data' => $data, 'row' => $row)) : '';//isset($button['title']) ? $button['title'] : '';
        $dialogWidth = isset($button['dialog-width']) ? $button['dialog-width'] :'';
        $dialogHeight = isset($button['dialog-height']) ? $button['dialog-height'] :'';
        $articleId=isset($button['id']) ? $this->evaluateExpression($button['id'], array('data' => $data, 'row' => $row)) : '';
        switch ($id) {
            case 'update':
                echo Html::linkEditColumn($url, $title, $dialogWidth, $dialogHeight,$articleId);
                break;
            case 'updateHasFile':
                echo Html::iconEditHasFile($url, $title, $dialogWidth, $dialogHeight);
                break;
            case 'active':
                echo Html::iconActive($url);
                break;
            case 'inactive':
                echo Html::iconInActive($url);
                break;
            case 'conversation':
                echo Html::iconConversation($url, $title, $dialogWidth, $dialogHeight);
                break;
            case 'note':
                echo Html::iconNote($url, $title, $dialogWidth, $dialogHeight);
                break;
            case 'function':
                echo Html::iconFunction($url, $title, $dialogWidth, $dialogHeight);
                break;
        }
    }

}

?>